#include<iostream>
typedef int QueueElementType;
using namespace std;
typedef struct Node
{
    QueueElementType data;
    struct Node *next;
    
}LinkQueueNode;

typedef struct{
    int data;
    Node *front;
    Node *rear;
}LinkQueue;
//初始化
void InitQueue(LinkQueue &Q){
    Q.front=Q.rear=new Node;
}
//入队
void InQueue(LinkQueue &Q,int x){
    Node *s=new Node;
    s->data=x;
    s->next=NULL;
    Q.rear->next=s;
    Q.rear=s;
}
//出队
bool DeleteQueue(LinkQueue &Q){
    //1.空：失败 Q.rear=Q.front
    if(Q.front==Q.rear) return false;
    //2.有一个：Q.rear指向Q.front,或者Q.front=NULL
    Node *p = Q.front->next;
    Q.front->next=p->next;
    if(Q.front->next==NULL){
        Q.rear=Q.front;
    }
    delete p;
    
    //3.有多个:不变
}
//显示队列所有整数
void PrintQueue(LinkQueue Q)
{
   Node *p;
   p = Q.front->next;
   printf("the queue is:");
   while(p != NULL)
    {
    printf("%d ", p->data);
    p = p->next;
    }
}

void ShowQueue(LinkQueue &Q){
    // Node *p=Q;
 //   while(p->next!=NULL){

   // }
}

int main(){
    LinkQueue Q;
    InitQueue(Q);
    Q.front->next=NULL;
    int x;
    while(cin>>x&&x!=-3){
        if(x>=10&&x<=99){
            InQueue(Q,x);
        }else if(x==-1){
            
        }else if(x==-2){
            PrintQueue(Q);
        }
    }
}